/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.anism.service;

import java.util.Collection;
import javax.ejb.EJB;
import javax.jws.WebService;
import javax.ejb.Stateless;
import org.anism.API.HolidayValidationLocal;
import org.anism.entity.Employee;
import org.anism.entity.HolidayRequest;

/**
 *
 * @author user
 */
@WebService(serviceName = "HolidayValidationService")
@Stateless()
public class HolidayValidationService {

    @EJB
    private HolidayValidationLocal holidayValidation;

    public Collection<HolidayRequest> listAllHolidayRequests(String login, String pass) {
        Employee e = holidayValidation.authenticate(login, pass);
        return holidayValidation.getAllHolidayRequests(e.getEmployeeId());
    }

    public boolean validateHoliday(int holidayCode) {
        HolidayRequest r = holidayValidation.getHolidayRequest(holidayCode);
        return holidayValidation.validateRequest(r);
    }
}
